package old.demo;

import old.factory.simple.Car;
import old.factory.simple.CarFactory;
import old.factory.yjinterface.HuaWeiFactory;
import old.factory.yjinterface.ProductFactory;
import old.factory.yjinterface.XiaomiFactory;

public class Main {
    public static void main(String[] args){
        System.out.println("hello world");

        Car car = CarFactory.getCat("五菱");
        car.display();

        car = CarFactory.getCat("大众");
        car.display();


        ProductFactory huaWeiFactory = new HuaWeiFactory();
        var phone = huaWeiFactory.iPhoneProduct();
        phone.call();
        phone.sendMSG();
        var router = huaWeiFactory.iRouterProduct();
        router.start();
        router.shutdown();

        ProductFactory xiaoFactory = new XiaomiFactory();
        var xiaomiIphone = xiaoFactory.iPhoneProduct();
        xiaomiIphone.call();
        xiaomiIphone.sendMSG();
        var xiaomiRouter = xiaoFactory.iRouterProduct();
        xiaomiRouter.start();
        xiaomiRouter.shutdown();

    }
}
